package demo1;

import java.util.ArrayList;
import java.util.List;

/**
 * 老板通知者.
 *
 * @author GongXincheng
 * @since 2019-09-23 13:46
 */
public class SubjectBoss extends BaseSubject {

    @Override
    void attach(BaseObserver observer) {
        this.getObserverList().add(observer);
    }

    @Override
    void detach(BaseObserver observer) {
        this.getObserverList().remove(observer);
    }

    @Override
    void notifyObserver() {
        this.getObserverList().forEach(BaseObserver::update);
    }
}
